// Package order_by_hot 6_92
// @Title order_by_hot
// @Description https://leetcode-cn.com/problems/reverse-linked-list-ii/
// @Author  == 琳琳也叫王木木 ==  2021/9/2 18:41
// @Create  2021/9/2 18:41
package order_by_hot

// 翻转列表II
// 用栈？
// 用双指针？

func ReverseBetween(head *ListNode, left int, right int) *ListNode {
	// 1. 获取链表长度
	linkLen := 0
	for cur := head; cur != nil; cur = cur.Next {
		linkLen++
	}
	// 入过长度大于链表长度
	if left > linkLen || right > linkLen {
		return head
	}
	return head
}
